########## The following definition must be set for qOS >= V2.8x #############
CFLAGS=-DNO_TYPEDEF_OS_FLAGS

########## Path for qOS core source files #################################
QOS_SRC=../../../../src

########## Path for qOS LINUX port source files ###########################
QOS_PORT_SRC=../../src

########## Path for qOS LINUX demo source files ########################
QOS_PORT_EX=./

########## Path for qOS LINUX port library file# ##########################
QOS_PORT_LIB=$(QOS_PORT_EX)

########## Name of Example source file ########################################
EXAMPLE=test


all: $(EXAMPLE).c os_cfg.h includes.h $(QOS_PORT_LIB)/qos.a makefile
	@echo --- Recompiling the application ---
	@gcc -g -D__LINUX__ $(CFLAGS) -I$(QOS_SRC) -I$(QOS_PORT_SRC) -I$(QOS_PORT_EX) $(EXAMPLE).c $(QOS_PORT_LIB)/qos.a -lm -lpthread -o $(EXAMPLE)

$(QOS_PORT_LIB)/qos.a:	os_cfg.h $(QOS_PORT_SRC)/os_cpu.h $(QOS_PORT_SRC)/os_cpu.c $(QOS_PORT_SRC)/pc.h $(QOS_SRC)/qos.h $(QOS_SRC)/qos.c
	@echo --- Recompiling library qos.a ---
	@gcc -g -c -D__LINUX__ $(CFLAGS) -I$(QOS_SRC) -I$(QOS_PORT_SRC) -I$(QOS_PORT_EX) $(QOS_SRC)/qos.c $(QOS_PORT_SRC)/os_cpu.c
	@ar -r $(QOS_PORT_LIB)/qos.a qos.o os_cpu.o

rebuilt: clean all

clean:
	@rm -f *.o
	@rm -f *.bak
	@rm -f *~
	@rm -f *.a
	@rm	-f $(EXAMPLE)

